package org.nepu.scr.indexrate.converter.upgraderate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.upgraderate.operationreliability.AppendixC5;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class AppendixC5Converter implements AttributeConverter<AppendixC5, String> {
    @Override
    public String convertToDatabaseColumn(AppendixC5 appendixC5) {
        return JSONUtil.toJsonStr(appendixC5);
    }

    @Override
    public AppendixC5 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, AppendixC5.class);
    }
}
